
#include <jni.h>
#include <dlfcn.h>
#include <android/log.h>
#include <string.h>
#include <malloc.h>
#include <stdbool.h>

#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "include/inlineHook.h"
#include <pthread.h>
#include <unistd.h>

//#include "mono/metadata/image.h"
//#include "mono/eglib/glib.h"


#define TAG "849040099"
#define LOGD(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__);
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__);


jboolean isU3d = false;



struct _MonoImage{
    int ref_count;
    void *raw_data_handle;
    char *raw_data;
    int raw_data_len;

}typedef MonoImage;

void str_replace(char *str, char *search, char *replace) {
    int i, j, k;
    int search_len = strlen(search);
    int replace_len = strlen(replace);
    char result[strlen(str)];
    for (i = 0, j = 0; str[i] != '\0'; ) {
        if (strncmp(&str[i], search, search_len) == 0) {
            for (k = 0; k < replace_len; k++) {
                result[j++] = replace[k];
            }
            i += search_len;
        } else {
            result[j++] = str[i++];
        }
    }
    result[j] = '\0';
    strcpy(str, result);
}



#define PACKAGE_NAME "com.tencent.tmgp.dragonball" // 目标应用的包名
#define TARGET_SO "/data/app/com.tencent.tmgp.dragonball-1/lib/arm/libgame.so" // 目标应用的libcocos2dlua.so
//#define TARGET_SO "/data/data/com.avalon.caveonline.cn.leiting/lib/libgame.so"


pthread_mutex_t mutex;
int shared_variable_lzjc = 1;
FILE *df = NULL;

//#define TARGET_SO "/data/data/com.sqview.arcard/lib/libmono.so"


MonoImage *  (*my_mono_image_init_mod_t)(char *data,
                                 size_t data_len,
                                 int  need_copy,
                                 void *status,
                                 int  refonly, char *name)=NULL;


int (*origin_luaL_loadbuffer)(void *lua_state, char *buff, size_t size, char *name) = NULL;
int (*origin_lua_pushlstring )(void *lua_State , char *s, size_t len) = NULL;
int (*origin_sub_14F3B0) (int a1,  char *a2 ) = NULL;
void free(void *__ptr);


int my_luaL_loadbuffer(void *lua_state, char *buff, size_t size, char *name) {
    pthread_mutex_lock(&mutex);
    LOGD("lua size: %d, name: %s", (uint32_t) size, name);  // 打印lua脚本的大小和名称

    if (name != NULL) {
        //strdup()在内部调用了malloc()为变量分配内存

        char *name_t = strdup(name);
        if (name_t != " " && name_t[0] != ' ') {
            FILE *file;
            char full_name[256];
            int name_len = strlen(name);
            if ( true) {
                LOGD("namelen:-----%d",name_len);
                char *base_dir = (char *) "/sdcard/hookLua/";
                int i = 0;
                while (i < name_len) {
                    if (name_t[i] == '/') {
                        name_t[i] = '.';
                    }
                    i++;
                }


                if(strstr(name,"357区 赛亚人之力")){

                    char* qbcd ="\nnk = 6\n"
                                "\n"
                                "function a()\n"
                                " sapp.log_error(\"您的凯撒的卡斯卡迪刷卡机的卡萨丁看就刷卡机的卡死的就卡死\" .. tostring(nk))\n"
                                "end\n"
                                "\n"
                                "local function errorHandler(err)\n"
                                "  sapp.log_error(debug.traceback(err))\n"
                                "end\n"
                                "function tableToString(t)\n"
                                "  local result = \"{\"\n "
                                "  for k, v in pairs(t) do\n"
                                "    if v ~= nil then\n"
                                "      -- 转换键\n"
                                "      if type(k) == \"number\" then\n"
                                "        k = \"[\" .. k .. \"]\"\n"

                                "      elseif type(k) == \"string\" then\n"
                                "        k = \"[\\\"\" .. k .. \"\\\"]\"\n"
//                                "      elseif type(k) == \"userdata\" or type(k) == \"thread\" then\n"
//                                "        -- 使用luaL_tolstring函数将userdata或thread转换为字符串\n"
//                                "        k = \"[\\\"\" .. luaL_tolstring(L, k, NULL) .. \"\\\"]\"\n"
                                "      end\n"
                                "\n"
                                " sapp.log_error('key'..k)\n "
                                "      -- 转换值\n"
                                "      if type(v) == \"number\" or type(v) == \"boolean\" then\n"
                                "        v = tostring(v)\n"
                                "      elseif type(v) == \"string\" then\n"
                                "        v = \"\\\"\" .. v .. \"\\\"\"\n"
                                "      elseif type(v) == \"function\" then\n"
                                "        v = \"function() end\"\n"
                                "      elseif type(v) == \"table\" then\n"
                                "        v = tableToString(v) -- 递归调用\n"
//                                "      elseif type(v) == \"userdata\" or type(v) == \"thread\" then\n"
//                                "        -- 使用luaL_tolstring函数将userdata或thread转换为字符串\n"
//                                "        v = \"\\\"\" .. luaL_tolstring(L, v, NULL) .. \"\\\"\"\n"
                                "      end\n"
                                "\n"
                                " sapp.log_error('value'..v)\n"
                                "      -- 拼接键值对\n"
                                "      result = result .. k .. \" = \" .. v .. \", \"\n"
                                "    end\n"
                                "  end\n"
                                "  -- 去掉最后的逗号和空格\n"
                                " -- result = result:sub(1, -3)\n"
                                "  result = result .. \"}\"\n"
                                "  return result\n"
                                "end\n"
                                "\n"
                                "\n"
                                "\n"
                                "a()\n"
                                "\n"
                                "function L1_1()\n"
//                                "L0_1 = fashion_touch\n"
//                                "function L1_1()\n"
//                                "  local L0_2, L1_2, L2_2, L3_2, L4_2, L5_2\n"
//                                "  L0_2 = fashion_main_vu_data\n"
//                                "  L0_2 = L0_2.select_fashion_info\n"
//                                "  if L0_2 ~= nil then\n"
//                                "    L1_2 =  L0_2.card_id\n"
//                                "    L2_2 = L0_2.fashion_id\n"
//                                "sapp.log_error('askdjasjdkjsakd'.. tostring(L0_2.fashion_id).. 'kkkkkk='.. tostring(L0_2.card_id))"
//                                "    L3_2 = fashion_main_vu\n"
//                                "    L3_2 = L3_2.show_mask\n"
//                                "    L3_2()\n"
//                                "    L3_2 = fashion_mgr\n"
//                                "    L3_2 = L3_2.req_fashion_wear\n"
//                                "    L4_2 = L1_2\n"
//                                "    L5_2 = L2_2\n"
//                                "    L3_2(L4_2, L5_2)\n"
//                                "  end\n"
//                                "  L1_2 = sound_eff\n"
//                                "  L1_2 = L1_2.sound_play\n"
//                                "  L2_2 = sound_eff\n"
//                                "  L2_2 = L2_2.touch_eff\n"
//                                "  L1_2(L2_2)\n"
//                                "  L1_2 = true\n"
//                                "  return L1_2\n"
//                                "end\n"
//                                "L0_1.touch_wear_fashion = L1_1\n"
"function L2_1(A0_2)\n"
                                "  local L1_2\n"
                                "  L1_2 = team_data\n"
                                "  L1_2.main_team_id = 6813\n"
                                "end\n"
//                                "team_data.set_main_team_id = L2_1\n"
//"team_data.del_team_info()\n team_data.set_main_team_id(6813)\n"
//                                "team_data.get_main_team_info=function()\n"
//                                "  local L0_2, L1_2, L2_2, L3_2, L4_2, L5_2, L6_2\n"
//                                "  L0_2 = team_data\n"
//                                "  L0_2 = L0_2.get_team_lst\n"
//                                "  L0_2 = L0_2()\n"
//                                "  L1_2 = pairs\n"
//                                "  L2_2 = L0_2\n"
//                                "  L1_2, L2_2, L3_2 = L1_2(L2_2)\n"
//                                "  for L4_2, L5_2 in L1_2, L2_2, L3_2 do\n"
//                                "  --sapp.log_error('nijkasjd时间大家都看撒娇的看见撒旦艰苦')\n  --sapp.log_error(tableToString(L5_2))\n"
//                                "    L6_2 = L5_2.is_default_team\n"
// //                                "L5_2['line1_card_ids'][4]=nil\nL5_2['line1_card_ids'][5]=nil\nL5_2['line1_card_ids'][6]=nil\n L5_2['line2_card_ids'][14]=nil\nL5_2['line2_card_ids'][15]=nil\nL5_2['line2_card_ids'][16]=nil\n"
//                                "    if L6_2 == true then\n"
//  //                                "    L5_2['line1_card_ids'][4]=nil\nL5_2['line1_card_ids'][5]=nil\nL5_2['line1_card_ids'][6]=nil\n L5_2['line2_card_ids'][14]=nil\nL5_2['line2_card_ids'][15]=nil\nL5_2['line2_card_ids'][16]=nil\n  "
//  //                                "kq={}\n kq[L4_2]=L5_2 team_data.team_lst=kq"
//                                "      return L5_2\n"
//                                "    end\n"
//                                "  end\n"
//                                "  L1_2 = nil\n"
//                                "  return L1_2\n"
//                                "end\n"
                                "    sapp.log_error(get_server_qufu_by_server_id(proxy_data.get_cur_proxy_info().server_id))\n"
                                "    sapp.log_error(\"呱呱呱呱呱呱刚刚广告公关广告\")\n"
                                "sapp.log_error('hahahaha'..tostring(team_data.get_cur_team_card_num()))"
                                "  \n"
                                "    function L2_1()\n"
                                "  \n"
                                "      local L0_2, L1_2, L2_2, L3_2, L4_2, L5_2, L6_2, L7_2, L8_2, L9_2, L10_2, L11_2\n"
                                "  \n"
                                "      L0_2 = {}\n"
                                "  \n"
                                "      L1_2 = {}\n"
                                "  \n"
                                "      L2_2 = team_data\n"
                                "  \n"
                                "      L2_2 = L2_2.check_team_is_full\n"
                                "  \n"
                                "      L2_2 = L2_2()\n"
                                "  \n"
                                "      if L2_2 == true then\n"
                                "  \n"
                                "        L3_2 = team_data\n"
                                "  \n"
                                "        L3_2 = L3_2.get_cur_team_down_card_lst\n"
                                "  \n"
                                "        L3_2 = L3_2()\n"
                                "  \n"
                                "        L1_2 = L3_2\n"
                                "  \n"
                                "        return L1_2\n"
                                "  \n"
                                "      end\n"
                                "  \n"
                                "      L3_2 = card_data\n"
                                "  \n"
                                "      L3_2 = L3_2.get_card_all\n"
                                "  \n"
                                "      L3_2 = L3_2()\n"
                                "  \n"
                                "      L4_2 = team_data\n"
                                "  \n"
                                "      L4_2 = L4_2.ready_for_sort_card_power\n"
                                "  \n"
                                "      L5_2 = L3_2\n"
                                "  \n"
                                "      L4_2 = L4_2(L5_2)\n"
                                "  \n"
                                "      L3_2 = L4_2\n"
                                "  \n"
                                "      L4_2 = table\n"
                                "  \n"
                                "      L4_2 = L4_2.sort\n"
                                "  \n"
                                "      L5_2 = L3_2\n"
                                "  \n"
                                "      L6_2 = team_change_vu\n"
                                "  \n"
                                "      L6_2 = L6_2.sort_card_power\n"
                                "  \n"
                                "      L4_2(L5_2, L6_2)\n"
                                "  \n"
                                "      L4_2 = 1\n"
                                "  \n"
                                "  \n"
                                "      sapp.log_error(\"设计的喀什假大空撒的就卡死 \".. proxy_data.get_cur_proxy_info().server_id)\n"
                                "      \n"
                                "      local num = tonumber(proxy_data.get_cur_proxy_info().server_id)\n"
                                "      L5_2 = nk\n"
                                "      if num > 363 and L5_2 >9 then\n"
                                "        L5_2 = 6\n"
                                "      end\n"
                                "  \n"
                                "      sapp.log_error('okkkkkkkkkkkkkkkkkkkkkkkkkkk')\n"
                                "      L6_2 = 1\n"
                                "  \n"
                                "      for L7_2 = L4_2, L5_2, L6_2 do\n"
                                "  \n"
                                "        L8_2 = L3_2[L7_2]\n"
                                "  \n"
                                "        L0_2[L7_2] = L8_2\n"
                                "  \n"
                                "      end\n"
                                "  \n"
                                "      L4_2 = team_data\n"
                                "  \n"
                                "      L4_2 = L4_2.sort_by_card_attr\n"
                                "  \n"
                                "      L5_2 = L0_2\n"
                                "  \n"
                                "      L4_2 = L4_2(L5_2)\n"
                                "  \n"
                                "      L0_2 = L4_2\n"
                                "  \n"
                                "      L4_2 = 1\n"
                                "  \n"
                                "      L5_2 = table\n"
                                "  \n"
                                "      L5_2 = L5_2.getall\n"
                                "  \n"
                                "      L6_2 = L0_2\n"
                                "  \n"
                                "      L5_2 = L5_2(L6_2)\n"
                                "  \n"
                                "      L6_2 = 1\n"
                                "  \n"
                                "      for L7_2 = L4_2, L5_2, L6_2 do\n"
                                "  \n"
                                "        L8_2 = L0_2[L7_2]\n"
                                "  \n"
                                "        if L8_2 ~= nil then\n"
                                "  \n"
                                "          L8_2 = {}\n"
                                "  \n"
                                "          if nk <=9 and L7_2 <= 3 then\n"
                                "            L8_2.pos = L7_2\n"
                                "          elseif nk <= 9 then\n"
                                "            L9_2 = L7_2 + 7\n"
                                "            L8_2.pos = L9_2\n"
                                "          else \n"
                                "            L8_2.pos = L7_2\n"
                                "          end\n"
                                "  \n"
                                "        \n"
                                "  \n"
                                "  \n"
                                "  \n"
                                "          L9_2 = L0_2[L7_2]\n"
                                "  \n"
                                "          L9_2 = L9_2.card_id\n"
                                "  \n"
                                "          L8_2.card_id = L9_2\n"
                                "  \n"
                                "          L9_2 = table\n"
                                "  \n"
                                "          L9_2 = L9_2.insert\n"
                                "  \n"
                                "          L10_2 = L1_2\n"
                                "  \n"
                                "          L11_2 = L8_2\n"
                                "  \n"
                                "          L9_2(L10_2, L11_2)\n"
                                "  \n"
                                "        end\n"
                                "  \n"
                                "      end\n"
                                "  \n"
                                "      return L1_2\n"
                                "  \n"
                                "    end\n"
                                "  \n"
                                "  \n"
//                                "     team_data.get_one_key_team  = L2_1\n"
//                                "--local qqq= team_data.get_one_key_team()\n \n"
//                                "--sapp.log_error(tableToString(qqq))\n"
                                "--sapp.log_error('qqqqqqqqqqqqqqqqqqjkjkjkqqqqqqqqqqqq')\n"
//                                "L1_1 = team_data\n"
//                                "function L2_1()\n"
//                                "return false\n"
//                                "end\n"
//                                "--L1_1.check_team_is_full = L2_1\n"
                                "  \n"
                                "  \n"
                                "  \n"
                                "  \n"
                                "  \n"
                                "  \n"
                                "\n"
//                                "    nchat.req_chat_msg=function(A0_2, A1_2, A2_2, A3_2, A4_2)\n"
//                                "        local L5_2, L6_2, L7_2, L8_2, L9_2, L10_2, L11_2\n"
//                                "        L5_2 = gnet\n"
//                                "        L5_2 = L5_2.send\n"
//                                "        L6_2 = A0_2\n"
//                                "        L7_2 = 1901\n"
//                                "        L8_2 = A1_2\n"
//                                "        L9_2 = A2_2\n"
//                                "        L10_2 = A3_2 .. '交流裙 四 八 九 七 八 三 五 幺 零'\n"
//                                "        L11_2 = A4_2\n"
//                                "        if A3_2 == \"七卡\" then\n"
//                                "          nk = 7\n"
//                                "        elseif A3_2 == \"八卡\" then\n"
//                                "          nk = 8\n"
//                                "        elseif A3_2 == \"九卡\" then\n"
//                                "          nk = 9\n"
//                                "        elseif A3_2 == \"十二卡\" then\n"
//                                "          nk = 20\n"
//                                "        else\n"
//                                "          nk = 6\n"
//                                "        end\n"
//                                "        sapp.log_error('童话'.. A3_2 .. 'sadsads' .. tostring(nk) )\nfloat_frame.open('不得用于商业收费用途。仅限学习交流，交流群489783510')\n"
//                                "kkk =  team_data.get_one_key_team()\n sapp.log_error('qkkk'..tableToString(kkk))"
//                                " kkk['line1_card_ids'][4]=nil\nkkk['line1_card_ids'][5]=nil\nkkk['line1_card_ids'][6]=nil\n"
//                                "kkk['line2_card_ids'][14]=nil\n kkk['line2_card_ids'][15]=nil\n kkk['line2_card_ids'][16]=nil\n"
//                                " sapp.log_error('kkkpk'.. tableToString(team_data.get_main_team_info()))"
//                                "        team_mgr.req_update_team(team_data.get_main_team_info().team_id,kkk)\n"
//
//                                "      \n"
//                                "        L5_2(L6_2, L7_2, L8_2, L9_2, L10_2, L11_2)\n"
//                                "      end\n"
                                "  \n"

//                                "\n sapp.log_error(tableToString(table_data.g_table.gd_base_fashion[120701]))\n"
                                " \n"

                                "\n  for k, v in pairs(card_star_power_data.star_lv_list) do card_star_power_data.star_lv_list[k]=0 end \n"
                                "\n  for k, v in pairs(card_star_power_data.star_list) do card_star_power_data.star_list[k][1]['star_power_level']=10001\n "
                                "card_star_power_data.star_list[k][2]['star_power_level']=10001\n"
                                "card_star_power_data.star_list[k][3]['star_power_level']=10001\n"
                                "card_star_power_data.star_list[k][4]['star_power_level']=10001\n"
                                "card_star_power_data.star_list[k][5]['star_power_level']=10001\n"
                                "card_star_power_data.star_list[k][6]['star_power_level']=10001\n"
                                " end \n"
                                "\n"
                                "L0_1 = card_star_power_data\n"
                                "function L1_1()\n"
                                "  local L0_2, L1_2, L2_2, L3_2, L4_2, L5_2, L6_2, L7_2, L8_2, L9_2, L10_2, L11_2, L12_2\n"
                                "  L0_2 = card_star_power_data\n"
                                "  L1_2 = {}\n"
                                "  L0_2.star_list = L1_2\n"
                                "  L0_2 = card_star_power_data\n"
                                "  L1_2 = {}\n"
                                "  L0_2.star_lv_list = L1_2\n"
                                "  L0_2 = card_data\n"
                                "  L0_2 = L0_2.get_card_all\n"
                                "  L0_2 = L0_2()\n"
                                "  L1_2 = ipairs\n"
                                "  L2_2 = L0_2\n"
                                "  L1_2, L2_2, L3_2 = L1_2(L2_2)\n"
                                "  for L4_2, L5_2 in L1_2, L2_2, L3_2 do\n"
                                "    L6_2 = card_star_power_data\n"
                                "    L6_2 = L6_2.init_one_black_power\n"
                                "    L7_2 = L5_2.card_id\n"
                                "    L6_2(L7_2)\n"
                                "    L6_2 = L5_2.star_power_group\n"
                                "    if L6_2 then\n"
                                "      L6_2 = L5_2.star_power_group\n"
                                "      L6_2 = L6_2.infos\n"
                                "      if L6_2 then\n"
                                "        L6_2 = L5_2.star_power_group\n"
                                "        L6_2 = L6_2.infos\n"
                                "        L6_2 = #L6_2\n"
                                "        if 0 < L6_2 then\n"
                                "          L6_2 = ipairs\n"
                                "          L7_2 = L5_2.star_power_group\n"
                                "          L7_2 = L7_2.infos\n"
                                "          L6_2, L7_2, L8_2 = L6_2(L7_2)\n"
                                "          for L9_2, L10_2 in L6_2, L7_2, L8_2 do\n"
                                "            L11_2 = card_star_power_data\n"
                                "            L11_2 = L11_2.update_star\n"
                                "            L12_2 = L10_2\n"
                                "            L11_2(L12_2)\n"
                                "          end\n"
                                "        end\n"
                                "      end\n"
                                "    end\n"
                                "    L6_2 = L5_2.star_power_group\n"
                                "    if L6_2 then\n"
                                "      L6_2 = L5_2.star_power_group\n"
                                "      L6_2 = L6_2.level\n"
                                "      if L6_2 then\n"
                                "        L6_2 = card_star_power_data\n"
                                "        L6_2 = L6_2.star_lv_list\n"
                                "        L7_2 = L5_2.card_id\n"
                                "        L8_2 = L5_2.star_power_group\n"
                                "        L8_2 = L8_2.level\n"
                                "        L6_2[L7_2] = 11\n"
                                "      end\n"
                                "    end\n"
                                "  end\n"
                                "end\n"
                                "L0_1.init_all_star_power = L1_1"
                                "\n"

                                "\n"
                                "L0_1 = card_star_power_data\n"
                                "function L1_1(A0_2)\n"
                                "  local L1_2, L2_2, L3_2, L4_2, L5_2, L6_2, L7_2\n"
                                "\n  for k, v in pairs(card_star_power_data.star_lv_list) do card_star_power_data.star_lv_list[k]=100 end \n"
                                "\n  for k, v in pairs(card_star_power_data.star_list) do card_star_power_data.star_list[k][1]['star_power_level']=10003\n "
                                "card_star_power_data.star_list[k][2]['star_power_level']=10003\n"
                                "card_star_power_data.star_list[k][3]['star_power_level']=10003\n"
                                "card_star_power_data.star_list[k][4]['star_power_level']=10003\n"
                                "card_star_power_data.star_list[k][5]['star_power_level']=10003\n"
                                "card_star_power_data.star_list[k][6]['star_power_level']=10003\n"
                                ""
                                "          L6_2 = card_star_power_data.star_list[k].card_id\n"
                                "          L7_2 = A0_2.card_id\n"
                                "          if L6_2 == L7_2 then\n"
                                "            L6_2 = card_star_power_vu\n"
                                "            L6_2 = L6_2.cur_select_info\n"
                                "            L6_2 = L6_2.star_power_id\n"
                                "            L7_2 = A0_2.star_power_id\n"
                                "            if L6_2 == L7_2 then\n"
                                "              L6_2 = card_star_power_vu\n"
                                "              L6_2 = L6_2.cur_select_info\n"
                                "              L7_2 = A0_2.star_power_level\n"
                                "              L6_2.star_power_level = 10003\n"
                                "            end\n"
                                "          end\n"
                                " end \n"
                                " L6_2 = card_star_power_vu\n"


                                "end\n"



                                "L0_1.update_star = L1_1"
                                "\n"

                                "L0_1 = arena_mgr\n"
                                "function L1_1(A0_2, A1_2, A2_2)\n"
                                "  local L3_2, L4_2, L5_2\n"
                                "sapp.log_error('哈哈哈哈黑暗圣经打卡机十九点')"
                                "sapp.log_error('A0_2: '+tableToString(A0_2))\n"
                                "sapp.log_error('A1_2: '+str(A1_2))\n"
                                "sapp.log_error('A2_2: '+str(A2_2))\n"
                                "  L3_2 = arena_pos_save\n"
                                "  L3_2 = L3_2.set_call_back_info\n"
                                "  L4_2 = arena_touch\n"
                                "  L4_2 = L4_2.team_challenge_bn\n"
                                "  L3_2(L4_2)\n"
                                "  L3_2 = arena_mgr\n"
                                "  L3_2 = L3_2.req_set_team\n"
                                "  L4_2 = A0_2\n"
                                "  L5_2 = A1_2\n"
                                "  L3_2(L4_2, L5_2)\n"
                                "end\n"
                                "L0_1.team_challenge_bn = L1_1\n"

                                "L0_1 = arena\n"
                                "function L1_1(A0_2, A1_2)\n"
                                "  local L2_2, L3_2, L4_2, L5_2, L6_2, L7_2, L8_2, L9_2, L10_2\n"
                                "  L2_2 = arena_data\n"
                                "  L2_2.top_ten_info_lst = A0_2\n"
                                "  L2_2 = arena_data\n"
                                "  L2_2 = L2_2.top_ten_info_lst\n"
//                                "sapp.log_error(tableToString(L2_2))\n"
                                "  if L2_2 ~= nil then\n"
                                "    L2_2 = actor_data\n"
                                "    L2_2 = L2_2.get_actor_id\n"
                                "    L2_2 = L2_2()\n"
                                "    L3_2 = actor_data\n"
                                "    L3_2 = L3_2.get_level\n"
                                "    L3_2 = L3_2()\n"
                                "    L4_2 = actor_data\n"
                                "    L4_2 = L4_2.get_vip_level\n"
                                "    L4_2 = L4_2()\n"
                                "    L5_2 = pairs\n"
                                "    L6_2 = arena_data\n"
                                "    L6_2 = L6_2.top_ten_info_lst\n"
                                "    L5_2, L6_2, L7_2 = L5_2(L6_2)\n"
                                "    for L8_2, L9_2 in L5_2, L6_2, L7_2 do\n"
                                "      L10_2 = L9_2.actor_id\n"
                                "L9_2.battle_power=L9_2.battle_power+50000000\n L9_2.vip_level=18 \n L9_2.actor_name='金钱打造气质'\nL9_2.level=175\n"
                                "      if L10_2 == L2_2 then\n"
                                "        L9_2.level = L3_2\n"
                                "        L9_2.vip_level = L4_2\n"
                                "      end\n"
                                "    end\n"
                                "  end\n"
                                "  L2_2 = arena_data\n"
                                "  L2_2.worshipped_lst = A1_2\n"
                                "end\n"
                                "L0_1.res_top_x_rank = L1_1\n"
                                "arena_data.set_my_sign('QQ849040099加我就完事了奥里给')\n"

                                "card_star_power_data.init_all_star_power()"
//                                "sapp.log_error(tableToString(card_star_power_data.star_lv_list))"
                                "  \n sapp.log_error('手机打开手机打开手机打开数据库的就卡死')\n"
                                "    local L0_2, L1_2, L2_2, L3_2, L4_2, L5_2, L6_2, L7_2, L8_2, L9_2, L10_2, L11_2, L12_2, L13_2, L14_2, L15_2\n"
                                "    L0_2 = language_des\n"
                                "    L0_2 = L0_2.android_back_quit\n"
                                "    L1_2 = tips_android_back_ctl\n"
                                "    L1_2 = L1_2.des\n"
                                "    if L1_2 ~= nil then\n"
                                "      L3_2 = L1_2\n"
                                "      L2_2 = L1_2.get_width\n"
                                "      L2_2 = L2_2(L3_2)\n"
                                "      L4_2 = L1_2\n"
                                "      L3_2 = L1_2.get_height\n"
                                "      L3_2 = L3_2(L4_2)\n"
                                "      L4_2 = create_new_richbox\n"
                                "      L5_2 = L2_2\n"
                                "      L6_2 = L3_2\n"
                                "      L7_2 = false\n"
                                "      L8_2 = false\n"
                                "      L4_2 = L4_2(L5_2, L6_2, L7_2, L8_2)\n"
                                "      if L4_2 ~= nil then\n"
                                "        L5_2 = sfont_util\n"
                                "        L5_2 = L5_2.measure_width\n"
                                "        L6_2 = L0_2\n"
                                "        L7_2 = \"\"\n"
                                "        L8_2 = 40\n"
                                "        L9_2 = 0\n"
                                "        L5_2 = L5_2(L6_2, L7_2, L8_2, L9_2)\n"
                                "        L7_2 = L4_2\n"
                                "        L6_2 = L4_2.insert_text\n"
                                "        L8_2 = L0_2\n"
                                "        L9_2 = \"\"\n"
                                "        L10_2 = 40\n"
                                "        L11_2 = 4294967295\n"
                                "        L12_2 = 0\n"
                                "        L13_2 = 4278190080\n"
                                "        L14_2 = 2\n"
                                "        L15_2 = false\n"
                                "        L6_2(L7_2, L8_2, L9_2, L10_2, L11_2, L12_2, L13_2, L14_2, L15_2)\n"
                                "        L7_2 = L4_2\n"
                                "        L6_2 = L4_2.get_all_height\n"
                                "        L6_2 = L6_2(L7_2)\n"
                                "        L6_2 = L6_2 + 4\n"
                                "        L8_2 = L4_2\n"
                                "        L7_2 = L4_2.set_width_height\n"
                                "        L9_2 = L5_2 + 2\n"
                                "        L10_2 = L6_2\n"
                                "        L7_2(L8_2, L9_2, L10_2)\n"
                                "        L8_2 = L1_2\n"
                                "        L7_2 = L1_2.add\n"
                                "        L9_2 = 0\n"
                                "        L10_2 = L4_2\n"
                                "        L7_2(L8_2, L9_2, L10_2)\n"
                                "        L8_2 = L4_2\n"
                                "        L7_2 = L4_2.set_position\n"
                                "        L9_2 = L2_2 / 2\n"
                                "        L10_2 = L5_2 / 2\n"
                                "        L9_2 = L9_2 - L10_2\n"
                                "        L10_2 = L3_2 / 2\n"
                                "        L11_2 = L6_2 / 2\n"
                                "        L10_2 = L10_2 - L11_2\n"
                                "        L7_2(L8_2, L9_2, L10_2)\n"
                                "      end\n"
                                "    end\n"
                                "  end\n"
                                "  tips_android_back.update_des_info = L1_1\n";
                    size_t qs = strlen(qbcd);
                    char flp[qs+size+20];
                    sprintf(flp, "%s%s", buff,qbcd);
                    str_replace(flp,"state=3","state=0");

                    pthread_mutex_unlock(&mutex);
                    return origin_luaL_loadbuffer(lua_state, flp, strlen(flp), flp);

//                    //lua脚本hook加载
//                    sprintf(full_name, "%s%s", base_dir,"aaaa");
//                    file = fopen(full_name, "r");
//                    if (file != NULL) {
//                        LOGD("[Tencent]-------path--- aaaaaaaaaaaaaaaaaaaaaaaaaajekdfjksjdjdksjdksjd--%s", full_name);
//                        fseek(file, 0, SEEK_END);
//                        size_t new_size = ftell(file);
//                        fseek(file, 0, SEEK_SET);
//                        char *new_buff = (char *) alloca(new_size + 1);
//                        fread(new_buff, new_size, 1, file);
//                        fclose(file);
// //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
//                        pthread_mutex_unlock(&mutex);
//
//                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, new_buff);
//                    }

                }
                //43090
                if(size == 46092) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2621.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
//                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

//                357,852
                if(size == 44439) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2617.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
 //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                //559,025
                if(size == 559052) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2056.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }


                //559,025
                if(size == 117810 ) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2063.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                if(size ==  362619) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2494");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);


//                        // 品阶
//                        sprintf(full_name, "%s%s", base_dir,"adc");
//                        file = fopen(full_name, "r");
//                        if(file !=NULL){
//                            fseek(file, 0, SEEK_END);
//                            size_t as = ftell(file);
//                            fseek(file, 0, SEEK_SET);
//                            char *new_as = (char *) alloca(as + 1);
//                            fread(new_as, as, 1, file);
//                            char flp[as+new_size+20];
//                            sprintf(flp, "%s%s", new_buff,new_as);
//                            pthread_mutex_unlock(&mutex);
//
//                            return origin_luaL_loadbuffer(lua_state, flp, strlen(flp), "data");
//                        }


                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                if(size == 357953) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"227.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                //46,444
                if(size == 46444 ) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2640.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                //3,855
                if(size == 3855 ) {
                    //lua脚本hook加载
                    sprintf(full_name, "%s%s", base_dir,"2346.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        char* qbcd =  "  \n sapp.log_error('qq--------------------------------*******8989898989')\n";


                        pthread_mutex_unlock(&mutex);
                        origin_luaL_loadbuffer(lua_state, qbcd, strlen(qbcd), qbcd);


                        qbcd =  "  \n sapp.log_error('qq--------------------------------*******')\n";
                        origin_luaL_loadbuffer(lua_state, qbcd, strlen(qbcd), qbcd);


                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "data");
                    }
                }

                //354785
//                if(size == 354785) {
//                    //lua脚本hook加载
//                    sprintf(full_name, "%s%s", base_dir,"3359.lua");
//                    file = fopen(full_name, "r");
//                    if (file != NULL) {
//                        LOGD("[Tencent]-------path-----%s", full_name);
//                        fseek(file, 0, SEEK_END);
//                        size_t new_size = ftell(file);
//                        fseek(file, 0, SEEK_SET);
//                        char *new_buff = (char *) alloca(new_size + 1);
//                        fread(new_buff, new_size, 1, file);
//                        fclose(file);
// //                        origin_luaL_loadbuffer(lua_state, buff, size, name);
//                        pthread_mutex_unlock(&mutex);
//
//                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, "3359");
//                    }
//                }

               /* if(strstr(name,"1区 贝吉塔")){
                    //lua脚本hook加载
                    sprintf(full_name, "%s%d", base_dir,657);
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
//                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, new_buff);
                    }

                }


                if(strstr(name,"201区 超级力量")){
                    //lua脚本hook加载
                    sprintf(full_name, "%s%d", base_dir,"json3.lua");
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path--- aaaaaaaaaaaaaaaaaaaaaaaaaajekdfjksjdjdksjdksjd--%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
//                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, new_buff);
                    }

                }

                if(strstr(name,"名字")){
                    //lua脚本hook加载
                    sprintf(full_name, "%s%d", base_dir,656);
                    file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
//                        origin_luaL_loadbuffer(lua_state, buff, size, name);
                        pthread_mutex_unlock(&mutex);

                        return origin_luaL_loadbuffer(lua_state, new_buff, new_size, new_buff);
                    }

                }*/
                df =  fopen("/sdcard/hookLua/lzjddebug.txt","r");

                if (df != NULL) {

                    fseek(df, 0, SEEK_END);
                    size_t new_size = ftell(df);
                    fseek(df, 0, SEEK_SET);
                    char *new_buff = (char *) alloca(new_size + 1);
                    fread(new_buff, new_size, 1, df);
                    fclose(df);
//                        origin_luaL_loadbuffer(lua_state, buff, size, name);

                    if(strstr(new_buff,"cp=1")){
                        sprintf(full_name, "%s%d", "/sdcard/hookLua/cp/",shared_variable_lzjc++);
                        LOGD("----------cpfilename--%s",full_name)

                          if(strstr(name_t,"data")) {
                              file = fopen(full_name, "wb");
                              if (file != NULL) {
                                  fwrite(buff, 1, size, file);
                                  fclose(file);
                                  free(name_t);
                              }
                          }else {
                              file = fopen(full_name, "wb");
                              if (file != NULL) {
                                  fwrite(name_t, sizeof(char), strlen(name_t), file);
                                  fclose(file);
                                  free(name_t);
                              }
                          }

                    }


//                    sprintf(full_name,"%d",(uint32_t) size);
//                    if(strstr(full_name,"46444")){
//                        sprintf(full_name, "%s%s", base_dir,"13.lua");
//
//                        if (file != NULL) {
//                            file = fopen(full_name, "r");
//                            LOGD("[Tencent]-------path-----%s", full_name);
//                            fseek(file, 0, SEEK_END);
//                            size_t new_size = ftell(file);
//                            fseek(file, 0, SEEK_SET);
//                            char *new_buff = (char *) alloca(new_size + 1);
//                            fread(new_buff, new_size, 1, file);
//                            fclose(file);
//
//                            pthread_mutex_unlock(&mutex);
//
//                            return   origin_luaL_loadbuffer(lua_state, new_buff, new_size, name);
//                        }
//                    }

                    pthread_mutex_unlock(&mutex);
                    return origin_luaL_loadbuffer(lua_state, buff, size, name);
                }




              /*  if(strstr(name_t,"data")) {
                    file = fopen(full_name, "wb");
                    if (file != NULL) {
                        fwrite(buff, 1, size, file);
                        fclose(file);
                        free(name_t);
                    }
                }else {
                    file = fopen(full_name, "wb");
                    if (file != NULL) {
                        fwrite(name_t, sizeof(char), strlen(name_t), file);
                        fclose(file);
                        free(name_t);
                    }
                }
*/
                //lua脚本保存

                pthread_mutex_unlock(&mutex);
//                if (strstr(name_t, ".lua")) {
//                    sprintf(full_name, "%s%s", base_dir, name_t);
//                    //lua脚本保存
//                    file = fopen(full_name, "ab+");
//                    if (file != NULL) {
//                        fwrite(buff, 1, size, file);
//                        fclose(file);
//                        free(name_t);
//                    }



                    //lua脚本hook加载
                    /*file = fopen(full_name, "r");
                    if (file != NULL) {
                        LOGD("[Tencent]-------path-----%s", full_name);
                        fseek(file, 0, SEEK_END);
                        size_t new_size = ftell(file);
                        fseek(file, 0, SEEK_SET);
                        char *new_buff = (char *) alloca(new_size + 1);
                        fread(new_buff, new_size, 1, file);
                        fclose(file);
                        return origin_luaL_loadbuffer(lua_state, buff, size, name);
                    }*/




//                }
            }
        }
    }

    return origin_luaL_loadbuffer(lua_state, buff, size, name);
}


int my_lua_pushlstring(void *lua_State , char *s, size_t len) {

//    LOGD("-----string---------------------%s%d", s,len);
    return origin_lua_pushlstring(lua_State, s, len);
}

int my_sub_14F3B0(int a1,  char *a2 ){
    LOGD("-----file_string---------------------%s", a2);
    return origin_sub_14F3B0(a1,a2);
}

//mono_image_open_from_data_with_name
//        (char *data,
//         guint32 data_len,
//         gboolean need_copy,
//         MonoImageOpenStatus *status,
//         gboolean refonly,
//         const char *name)
//data: 脚本内容
//
//data_len:脚本长度
//
//name:脚本名称

MonoImage * my_mono_image_init_mod(char *data,
                                   size_t data_len,
                                   int need_copy,
                                   void *status,
                                   int refonly,
                                   char *name) {


    if (name != NULL) {
        //strdup()在内部调用了malloc()为变量分配内存
        char *name_t = strdup(name);
        if (name_t != " " && name_t[0] != ' ') {
            FILE *file;
            char full_name[256];
            int name_len = strlen(name);
            //if (8 < name_len <= 100) {
            char *base_dir = (char *) "/sdcard/hookDll/";
            int i = 0;
            while (i < name_len) {
                //将 / 换成 .
                if (name_t[i] == '/') {
                    name_t[i] = '.';
                }
                i++;
            }
            //lua脚本保存
            file = fopen(full_name, "wb");
            if (file != NULL) {
                fwrite(data, 1, data_len, file);
                fclose(file);
                free(name_t);
            }

        }
    }
    return my_mono_image_init_mod_t(data,data_len,need_copy,status,refonly,name);

}


JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
    LOGD("线程锁init");
    pthread_mutexattr_init(&mutex);

    LOGD("JNI_OnLoad enter");
    //在 onload 改变 指定函数 函数地址 替换成自己的
    JNIEnv *env = NULL;
    if ((*vm)->GetEnv(vm, (void **) &env, JNI_VERSION_1_6) == JNI_OK) {
        LOGD("GetEnv OK");

        char so_name[128] = {0};
        //吧 TARGET_SO 内容写到so_name
        sprintf(so_name, TARGET_SO, PACKAGE_NAME);
        //该函数将打开一个新库 返回个句柄
        void *handle = dlopen(so_name, RTLD_NOW);


        if (handle) {
            LOGD("dlopen() return %08x", (uint32_t) handle);


            if (isU3d) {
                //从句柄里拿到 luaL_loadbuffer 函数
                //根据 动态链接库 操作句柄(handle)与符号(symbol)，
                // 返回符号对应的地址。使用这个函数不但可以获取函数地址，
                // 也可以获取变量地址。
                //是否是 dump  u3d的
                void *mono_image_open = dlsym(handle, "mono_image_open_from_data_with_name");

                LOGD("dlsym() ", (uint32_t) mono_image_open);
                if (mono_image_open) {
                    if (ELE7EN_OK == registerInlineHook((uint32_t) mono_image_open,
                                                        (uint32_t) my_mono_image_init_mod,
                                                        (uint32_t **) &my_mono_image_init_mod_t)) {

                        LOGD("registerInlineHook mono_image_open_from_data_with_name success");
                        if (ELE7EN_OK == inlineHook((uint32_t) mono_image_open)) {
                            LOGD("inlineHook mono_image_open_from_data_with_name success");
                        } else {
                            LOGD("inlineHook mono_image_open_from_data_with_name failure");
                        }
                    } else {
                        LOGD("registerInlineHook mono_image_open_from_data_with_name failure");
                    }
                }
///         dump lua的 Hook的 函数
            } else {
                LOGD(TAG, "Lua");

//                void *sub_14F3B0 = dlsym(handle, "sub_14F3B0");
//
//                if(sub_14F3B0) {
//                    LOGD("sub_14F3B0 function address:%08X", (uint32_t) sub_14F3B0);
//                    //这行 是 你需要 Hook的 函数 和原函数名字的 地址进行替换
//                    if (ELE7EN_OK == registerInlineHook((uint32_t) sub_14F3B0,
//                                                        (uint32_t) my_sub_14F3B0,
//                                                        (uint32_t **) &origin_sub_14F3B0)) {
//                        LOGD("registerInlineHook sub_14F3B0 success");
//                        if (ELE7EN_OK == inlineHook((uint32_t) sub_14F3B0)) {
//                            LOGD("inlineHook sub_14F3B0 success");
//                        }
//                    }
//                }

                void *luabuffer = dlsym(handle, "luaL_loadbuffer");       //luaL_loadbuffer
                LOGD(TAG, "luaL_loadbuffer");


                if (luabuffer) {
                    LOGD("luaL_loadbuffer function address:%08X", (uint32_t) luabuffer);
                    //这行 是 你需要 Hook的 函数 和原函数名字的 地址进行替换
                    if (ELE7EN_OK == registerInlineHook((uint32_t) luabuffer,
                                                        (uint32_t) my_luaL_loadbuffer,
                                                        (uint32_t **) &origin_luaL_loadbuffer)) {
                        LOGD("registerInlineHook luaL_loadbuffer success");
                        if (ELE7EN_OK == inlineHook((uint32_t) luabuffer)) {
                            LOGD("inlineHook luaL_loadbuffer success");
                        }
                    }
                }

                LOGD(TAG,"+++++++++++++lua_pushlstring+++++++++++++")
                void *pushlstring = dlsym(handle,"lua_pushlstring");
                if (pushlstring){
//                LOGD(TAG,"pushstring--suc")
                    //这行 是 你需要 Hook的 函数 和原函数名字的 地址进行替换
                    if (ELE7EN_OK == registerInlineHook((uint32_t) pushlstring,
                                                        (uint32_t) my_lua_pushlstring,
                                                        (uint32_t **) &origin_lua_pushlstring)) {
                        LOGD("registerInlineHook lua_pushlstring success");
                        if (ELE7EN_OK == inlineHook((uint32_t) pushlstring)) {
                            LOGD("inlineHook lua_pushlstring success");
                        }
                    }
                }
            }




        }
        LOGD("JNI_OnLoad leave");
        return JNI_VERSION_1_6;
    }
}


